import request from '@/utils/request'

// 获取角色列表
export const getRoleListApi = (page, pagesize) => {
  return request({
    url: '/sys/role',
    params: {
      page,
      pagesize
    }
  })
}

// 删除角色
// export const deleteListApi = (id) => {
//   return request.delete(`/sys/role/${id}`)
// }

export function deleteRoleApi(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'
  })
}

// 添加-角色
export const addRoleApi = (data) => {
  return request.post('/sys/role', data)
}

// 获取-角色详情（数据回填）
export const getRoleDetailApi = (id) => {
  return request.get(`/sys/role/${id}`)
}
// 修改-角色详情
export const editRoleApi = (data) => {
  return request.put(`/sys/role/${data.id}`, data)
}

// 获取公司信息
export const getCompanyInfoApi = id => {
  return request({
    url: `/company/${id}`
  })
}
